﻿using System.Collections.Generic;
using System.Linq;
using JStore.Core.Entities;
using SpeadFrm.ORM;

namespace JStore.Data.Daos
{
    /// <summary>
    ///
    /// </summary>
    public class UserRoleDao : BaseDao<UserRole>
    {
        public List<UserRole> GetAll()
        {
            var sql = Sql.Builder.Where("1=1");
            return Query(sql).ToList();
        }

        public UserRole GetByRoleId(int roleId)
        {
            var sql = Sql.Builder.Where("RoleId = @0", roleId);
            return FirstOrDefault(sql);
        }

      
    }
}

